#include <wx/wx.h>

class HelloWorldApp : public wxApp {
public:
    virtual bool OnInit();
};

class HelloWorldFrame : public wxFrame {
public:
    HelloWorldFrame(const wxString& title);

    void OnQuit(wxCommandEvent& event);
    void OnAbout(wxCommandEvent& event);
};

enum {
    ID_Quit = 1,
    ID_About,
};

IMPLEMENT_APP(HelloWorldApp)

bool HelloWorldApp::OnInit() {
    HelloWorldFrame *frame = new HelloWorldFrame( _("Hello World") );
    frame->Show(true);
    return true;
}

HelloWorldFrame::HelloWorldFrame(const wxString& title)
    : wxFrame(NULL, wxID_ANY, title) {
    wxMenu *menuFile = new wxMenu;
    menuFile->Append(ID_About, _("&About..."));
    menuFile->AppendSeparator();
    menuFile->Append(ID_Quit, _("E&xit"));

    wxMenuBar *menuBar = new wxMenuBar;
    menuBar->Append(menuFile, _("&File"));

    SetMenuBar(menuBar);

    CreateStatusBar();
    SetStatusText(_("Welcome to wxWidgets!"));
}

void HelloWorldFrame::OnQuit(wxCommandEvent& event) {
    Close(true);
}

void HelloWorldFrame::OnAbout(wxCommandEvent& event) {
    wxMessageBox(_("This is a wxWidgets' Hello world sample"),
                 _("About Hello World"), wxOK | wxICON_INFORMATION);
}
